package cn.edu.zime.tjh.iotapp.model;

/**
 * 设备数据模型类，严格按照后端API接口规范定义
 */
public class Device {
    private String device_id;       // 设备唯一标识
    private String device_name;     // 设备名称
    private String device_type;     // 设备类型
    private String device_status;   // 设备状态
    private String device_info;     // 设备附加信息
    private String device_web;      // 设备Web页面地址
    private String create_time;     // 创建时间，从详情接口获取
    
    // 无参构造函数
    public Device() {
        // 默认设备状态为激活
        this.device_status = "active";
    }
    
    // 构造函数
    public Device(String device_id, String device_name) {
        this.device_id = device_id;
        this.device_name = device_name;
        this.device_status = "active"; // 默认设备状态为激活
    }
    
    // 完整构造函数
    public Device(String device_id, String device_name, String device_type, 
                 String device_status, String device_info, String device_web, String image) {
        this.device_id = device_id;
        this.device_name = device_name;
        this.device_type = device_type;
        this.device_status = device_status != null ? device_status : "active";
        this.device_info = device_info;
        this.device_web = device_web;
    }
    
    // Getters and Setters
    public String getDevice_id() {
        return device_id;
    }
    
    public void setDevice_id(String device_id) {
        this.device_id = device_id;
    }
    
    public String getDevice_name() {
        return device_name;
    }
    
    public void setDevice_name(String device_name) {
        this.device_name = device_name;
    }
    
    public String getDevice_type() {
        return device_type;
    }
    
    public void setDevice_type(String device_type) {
        this.device_type = device_type;
    }
    
    public String getDevice_status() {
        return device_status;
    }
    
    public void setDevice_status(String device_status) {
        this.device_status = device_status;
    }
    
    public boolean isOnline() {
        return "active".equals(device_status);
    }
    
    public String getDevice_info() {
        return device_info;
    }
    
    public void setDevice_info(String device_info) {
        this.device_info = device_info;
    }
    
    public String getDevice_web() {
        return device_web;
    }
    
    public void setDevice_web(String device_web) {
        this.device_web = device_web;
    }
    
    public String getCreate_time() {
        return create_time;
    }
    
    public void setCreate_time(String create_time) {
        this.create_time = create_time;
    }

    public String getDeviceId() {
        return getDevice_id();
    }
    
    public void setDeviceId(String deviceId) {
        setDevice_id(deviceId);
    }
    
    public String getDeviceName() {
        return getDevice_name();
    }
    
    public void setDeviceName(String deviceName) {
        setDevice_name(deviceName);
    }
    
    public String getDeviceType() {
        return getDevice_type();
    }
    
    public void setDeviceType(String deviceType) {
        setDevice_type(deviceType);
    }
    
    public String getDeviceStatus() {
        return getDevice_status();
    }
    
    public void setDeviceStatus(String deviceStatus) {
        setDevice_status(deviceStatus);
    }
    
    public String getDeviceInfo() {
        return getDevice_info();
    }
    
    public void setDeviceInfo(String deviceInfo) {
        setDevice_info(deviceInfo);
    }
    
    public String getDeviceWeb() {
        return getDevice_web();
    }
    
    public void setDeviceWeb(String deviceWeb) {
        setDevice_web(deviceWeb);
    }
} 